﻿using System.Text;
using System.Windows;
using Hx.Components.Models;

namespace Hx.Client
{
    public partial class ArticleShowWindow
    {
        public ArticleShowWindow()
        {
            InitializeComponent();
        }

        public void ShowContent(ArticleModel post)
        {
            Title = post.Title;
            var sb = new StringBuilder(@"<html>
<head>
    <title>" + post.Title + @"</title>
    <meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8""/>
</head>
<body>");
            sb.AppendLine(post.ArticleContent);
            sb.AppendLine(@"</body>
</html>");
            ArticleWebBrowser.NavigateToString(sb.ToString());

            WindowState = WindowState.Maximized;
            Show();
        }
    }
}